﻿@model AugustaDevelopersGuild.Models.Meeting
@using AugustaDevelopersGuild.Helpers
@{
    ViewBag.Title = "Meeting";
}
<p>
    The Augusta Developers Guild is meeting on @Model.EventDate.ToString("dddd, dd MMMM yyyy")
    @@ @Model.EventDate.ToShortTimeString(). @Model.Speaker will be presenting '@Model.Topic'.
</p>
<h3>Presenter - @Model.Speaker</h3>
<p>@Model.Bio</p>
<h3>Topic - @Model.Topic</h3>
<p>@Model.Abstract</p>
@Html.Partial("_RsvpStatus")
<p>
    <strong>Who's Coming:</strong>
    @if (Model.Rsvps.Count == 0)
    {
        <text>No one has registered.</text>
    }
</p>
@if (Model.Rsvps.Count > 0)
{
    <ul>
        @{  var RSVPs = Model.Rsvps.Reverse(); }
        @foreach (var RSVP in RSVPs)
        { 
            <li>@(RSVP.AttendeeName.StartsWith("@") ? RSVP.AttendeeName : RSVP.AttendeeName.Replace("@", " at ").Truncate(30))</li>
        }
    </ul>
        
}
<p>
    @if (User.IsInRole("Admin"))
    {
        @Html.ActionLink("Edit", "Edit", new { id = Model.MeetingID })
    }
    @Html.ActionLink("Back to List", "Index", "Home")
</p>
